<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      p {
        /* height: 300px; */
        border: solid;
      }
    </style>
  </head>
  <body>
    <p>hello p1</p>
    <p>hello p2</p>
    <p>hello p3</p>
    <p>hello p4</p>
    <p id="p5">hello p5</p>
    <p>hello p6</p>
    <p>hello p7</p>

    <script>
      const p5 = document.getElementById("p5");
      p5.onclick = function (e) {
        console.log("窗口坐标", e.clientX, e.clientY);
        console.log("页面坐标", e.pageX, e.pageY);
      };
    </script>
  </body>
</html>
